Fix agent list settings schema#189
Open
danielrobbins wants to merge 2 commits into
Open
Conversation
The llama-vscode.agents_list schema defined the canonical property as systemInstruction but incorrectly required system_instruction. That produced false settings diagnostics for valid camelCase entries, while the runtime configuration loader still only consumed the camelCase field. Fix the mismatch by correcting the schema, making subagentEnabled a boolean, and documenting system_instruction as a deprecated alias. In the configuration loader, normalize agents_list into the canonical in-memory Agent shape while accepting both systemInstruction and legacy system_instruction inputs. Accepting both syntaxes is the safer compatibility path: it removes the bogus validation error for current settings without breaking existing user configs that already persisted the legacy snake_case key. The loader does not rewrite user settings; it only canonicalizes the data after reading it.
conflicts with current @types/vscode declarations. The original shim was added when llama-vscode needed to supply its own temporary LM chat-provider typings. That is no longer necessary because current @types/vscode releases already include the relevant language model chat APIs. Leaving the old shim in place causes duplicate declaration errors during TypeScript compilation. Properties such as modelOptions, tools, maxInputTokens, maxOutputTokens, and LanguageModelResponsePart are now defined both by @types/vscode and by the local shim, which breaks the build even though the runtime code itself is otherwise valid. This change removes the dead shim file entirely and keeps one small provider typing cleanup in llama-chat-model-provider.ts so the current tool metadata mapping aligns with the upstream VS Code types. After this cleanup, the repo compiles cleanly against the installed @types/vscode package without relying on duplicate local declarations. This cleanup is also required for the separate VS Code tool serialization fix to build cleanly. Without removing the obsolete shim, that branch still fails compilation on current @types/vscode before its behavioral changes can be validated in a normal TypeScript build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a schema/runtime mismatch in
llama-vscode.agents_list.The extension settings schema treated
system_instructionas the required field, while the runtime configuration loader expected the canonical camelCase fieldsystemInstruction. In practice, that produced false validation errors for valid agent settings and made the settings experience inconsistent.What changed
llama-vscode.agents_listschema so it matches the runtime shapesystemInstructionas the canonical fieldsystem_instructioninput as a compatibility aliassubagentEnabledto use a boolean schema valueWhy this is needed
Before this change, valid camelCase agent settings could be flagged incorrectly by the schema even though the runtime expected that form. At the same time, older persisted settings using the snake_case key could still exist in user configs.
This PR removes that mismatch while preserving backward compatibility for existing user settings.
Compatibility
systemInstructionremains the canonical settings keysystem_instructionis still accepted on readScope
This PR is intended to be a focused settings/schema compatibility fix.
Note: this branch currently also includes the prerequisite shim cleanup from #187 so it compiles cleanly against current VS Code typings. That overlap is not logically part of the agent-settings fix itself.
Validation